.viewer {
  &-zoom-in,
  &-zoom-out,
  &-one-to-one,
  &-reset,
  &-prev,
  &-play,
  &-next,
  &-rotate-left,
  &-rotate-right,
  &-flip-horizontal,
  &-flip-vertical,
  &-fullscreen,
  &-fullscreen-exit,
  &-close,
  &-fullscreen-modal {
    &::before {
      background-image: url("../images/icons.png");
      background-repeat: no-repeat;
      background-size: 890px;
      color: transparent;
      display: block;
      font-size: 0;
      height: 40px;
      line-height: 0;
      width: 40px;
    }
  }

  &-zoom-in::before {
    background-position: -2px -2px;
    content: "Zoom In";
  }

  &-zoom-out::before {
    background-position: -64px -2px;
    content: "Zoom Out";
  }

  &-one-to-one::before {
    background-position: -124px -2px;
    content: "One to One";
  }

  &-reset::before {
    background-position: -182px -2px;
    content: "Reset";
  }

  &-prev::before {
    background-position: -242px -2px;
    content: "Previous";
  }

  &-play::before {
    background-position: -303px -2px;
    content: "Play";
  }

  &-next::before {
    background-position: -360px -2px;
    content: "Next";
  }

  &-rotate-left::before {
    background-position: -423px -2px;
    content: "Rotate Left";
  }

  &-rotate-right::before {
    background-position: -482px -2px;
    content: "Rotate Right";
  }

  &-flip-horizontal::before {
    background-position: -542px -2px;
    content: "Flip Horizontal";
  }

  &-flip-vertical::before {
    background-position: -600px -2px;
    content: "Flip Vertical";
  }

  &-fullscreen::before {
    background-position: -672px 4px;
    content: "Enter Full Screen";
  }

  &-fullscreen-exit::before {
    background-position: -733px 4px;
    content: "Exit Full Screen";
  }

  &-close::before {
    background-position: -794px 4px;
    content: "Close";
  }

  &-fullscreen-modal::before {
    background-position: -662px -2px;
    content: "Full Screen Modal";
  }

  &-download::before {
    background-position: -842px -2px;
    content: "Download";
  }

  &-container {
    bottom: 0;
    direction: ltr;
    font-size: 0;
    left: 0;
    line-height: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    -webkit-tap-highlight-color: transparent;
    top: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;

    &::selection,
    & *::selection {
      background-color: transparent;
    }

    &:focus {
      outline: 0;
    }

    & img {
      display: block;
      height: auto;
      max-height: none !important;
      max-width: none !important;
      min-height: 0 !important;
      min-width: 0 !important;
      width: 100%;
    }
  }

  &-canvas {
    bottom: 0;
    left: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 0;

    & > img {
      height: auto;
      margin: 15px auto;
      max-width: 90% !important;
      width: auto;
    }
  }

  &-footer {
    bottom: 0;
    left: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    text-align: center;
  }

  &-navbar {
    background-color: rgba(0, 0, 0, 50%);
    overflow: hidden;
  }

  &-list {
    box-sizing: content-box;
    height: 50px;
    margin: 0;
    overflow: hidden;
    padding: 1px 0;

    & > li {
      color: transparent;
      cursor: pointer;
      float: left;
      font-size: 0;
      height: 50px;
      line-height: 0;
      opacity: 0.5;
      overflow: hidden;
      transition: opacity 0.15s;
      width: 30px;

      &:focus,
      &:hover {
        opacity: 0.75;
      }

      &:focus {
        outline: 0;
      }

      & + li {
        margin-left: 1px;
      }
    }

    & > .viewer-loading {
      position: relative;

      &::after {
        border-width: 2px;
        height: 20px;
        margin-left: -10px;
        margin-top: -10px;
        width: 20px;
      }
    }

    & > .viewer-active {
      &,
      &:focus,
      &:hover {
        opacity: 1;
      }
    }
  }

  &-player {
    background-color: #000;
    bottom: 0;
    cursor: none;
    display: none;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 1;

    & > img {
      left: 0;
      position: absolute;
      top: 0;
    }
  }

  &-toolbar {
    & > ul {
      display: inline-block;
      margin: 0 auto 5px;
      overflow: hidden;
      padding: 6px 3px;

      & > li {
        background-color: rgba(0, 0, 0, 50%);
        border-radius: 50%;
        cursor: pointer;
        float: left;
        height: 50px;
        margin: 0 5px;
        overflow: hidden;
        transition: background-color 0.15s;
        width: 50px;

        &:focus,
        &:hover {
          background-color: #0f62c3;
        }

        &:focus {
          box-shadow: 0 0 3px #fff;
          outline: 0;
          position: relative;
          z-index: 1;
        }

        &::before {
          margin: 2px;
        }

        & + li {
          margin-left: 1px;
        }
      }

      & > .viewer-small {
        height: 18px;
        margin-bottom: 3px;
        margin-top: 3px;
        width: 18px;

        &::before {
          margin: -1px;
        }
      }

      & > .viewer-large {
        height: 60px;
        margin-bottom: -3px;
        margin-top: -3px;
        width: 60px;

        &::before {
          margin: 5px;
        }
      }
    }
  }

  &-tooltip {
    background-color: rgba(0, 0, 0, 80%);
    border-radius: 10px;
    color: #fff;
    display: none;
    font-size: 12px;
    height: 20px;
    left: 50%;
    line-height: 20px;
    margin-left: -25px;
    margin-top: -10px;
    position: absolute;
    text-align: center;
    top: 50%;
    width: 50px;
  }

  &-title-tooltip {
    color: #fff;
    display: inline-block;
    font-size: 28px;
    line-height: 1.2;
    margin: 5px 5%;
    max-width: 90%;
    min-height: 14px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
    white-space: nowrap;

    &:hover {
      opacity: 1;
    }
  }

  &-button {
    -webkit-app-region: no-drag;
    background-color: rgba(0, 0, 0, 50%);
    border-radius: 50%;
    cursor: pointer;
    height: 80px;
    overflow: hidden;
    position: absolute;
    right: -40px;
    top: -40px;
    transition: background-color 0.15s;
    width: 80px;

    &:focus,
    &:hover {
      background-color: rgba(0, 0, 0, 80%);
    }

    &:focus {
      box-shadow: 0 0 3px #fff;
      outline: 0;
    }

    &::before {
      bottom: 15px;
      left: 15px;
      position: absolute;
    }
  }

  &-fixed {
    position: fixed;
  }

  &-open {
    overflow: hidden;
  }

  &-show {
    display: block;
  }

  &-hide {
    display: none;
  }

  &-backdrop {
    background-color: rgba(0, 0, 0, 50%);
  }

  &-invisible {
    visibility: hidden;
  }

  &-move {
    cursor: move;
    cursor: grab;
  }

  &-fade {
    opacity: 0;
  }

  &-in {
    opacity: 1;
  }

  &-transition {
    transition: all 0.3s;
  }

  @keyframes viewer-spinner {
    0% {
      transform: rotate(0deg);
    }

    100% {
      transform: rotate(360deg);
    }
  }

  &-loading {
    &::after {
      animation: viewer-spinner 1s linear infinite;
      border: 4px solid rgba(255, 255, 255, 10%);
      border-left-color: rgba(255, 255, 255, 50%);
      border-radius: 50%;
      content: "";
      display: inline-block;
      height: 40px;
      left: 50%;
      margin-left: -20px;
      margin-top: -20px;
      position: absolute;
      top: 50%;
      width: 40px;
      z-index: 1;
    }
  }

  @media (max-width: 767px) {
    &-hide-xs-down {
      display: none;
    }
  }

  @media (max-width: 991px) {
    &-hide-sm-down {
      display: none;
    }
  }

  @media (max-width: 1199px) {
    &-hide-md-down {
      display: none;
    }
  }
}
